import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import './assets/fonts/iconfont.css'
import './assets/css/base.css'
import VueRouter from 'vue-router'
import {
  Tabbar, TabbarItem, Icon, Swipe, SwipeItem, Grid, GridItem, PullRefresh, List, NavBar, GoodsAction, GoodsActionIcon,
  GoodsActionButton, Popup, Card, Button, Stepper, Form, Field, Checkbox, SwipeCell, SubmitBar, AddressEdit, AddressList,
  ContactCard, Search, Lazyload
} from 'vant'
import loading from 'plugins/loading'
const loadingImg = require('./assets/imgs/loading.jpg')
Vue.use(loading)
Vue.use(Tabbar)
  .use(TabbarItem)
  .use(Icon)
  .use(Swipe)
  .use(SwipeItem)
  .use(Grid)
  .use(GridItem)
  .use(PullRefresh)
  .use(List)
  .use(NavBar)
  .use(GoodsAction)
  .use(GoodsActionIcon)
  .use(GoodsActionButton)
  .use(Popup)
  .use(Card)
  .use(Button)
  .use(Stepper)
  .use(Form)
  .use(Field)
  .use(Checkbox)
  .use(SwipeCell)
  .use(SubmitBar)
  .use(AddressEdit)
  .use(AddressList)
  .use(ContactCard)
  .use(Search)
  .use(Lazyload, {
    loading: loadingImg,
    error: '',
    preload: '1'
  })
Vue.config.productionTip = false
const originalReplace = VueRouter.prototype.push
VueRouter.prototype.push = function push (location) {
  return originalReplace.call(this, location).catch(err => err)
}
Vue.use(VueRouter)
new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
